package com.labraff.redvideo;

import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;

public class detail extends FragmentActivity {
    news newsItem;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail);


        FragmentManager manager = getFragmentManager();
        DetailFragment detailFragment = (DetailFragment) manager.findFragmentById(R.id.fragment_detail);

        Bundle bundle = this.getIntent().getExtras();
        newsItem  = (news) bundle.get("newsItem");
        detailFragment.setData(newsItem,false);

    }


    public void setNewsItem(news newsItem){
        this.newsItem = newsItem;
    }
    public news getNewsItem(){
        return this.newsItem;
    }
}